package com.seata.cloud.controller;

import com.seata.cloud.OrderFacede;
import com.seata.cloud.dto.OrderDTO;
import com.seata.cloud.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangyabin
 * @date 2021/11/26 13:23
 */
@RestController
@RequestMapping("/f/order")
public class FOrderController {
    
    @Autowired
    private OrderFacede orderFacede;

    /**
     * 创建订单
     */
    @PostMapping("/create")
    public Result create(@RequestBody OrderDTO order) {
        orderFacede.create(order);
        return Result.success("订单创建成功!", 200);
    }

    /**
     * 创建订单
     */
    @GetMapping("/test")
    public Result test(){
        return Result.success("请求成功!", 200);
    }
}
